package com.tencreat.service.im;


import com.tencreat.domain.im.dto.*;
import com.tencreat.domain.im.vo.OpenIMAccountCheckVo;
import com.tencreat.domain.im.vo.OpenIMAccountCheckWrapVo;
import com.tencreat.domain.im.vo.OpenIMResultVo;
import com.tencreat.domain.im.vo.OpenIMTokenVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "openIM-service", url = "EMPTY", configuration = CommonFeignConfiguration.class)
public interface OpenIMApi {
    String IM_LOGIN_TOKEN = "OPENIM_LOGIN_TOKEN";
    String IM_ADMIN_LOGIN_TOKEN = "OPENIM_ADMIN_LOGIN_TOKEN";

    /*注册用户*/
    @PostMapping(path = "/user/account_check")
    public OpenIMResultVo<OpenIMAccountCheckWrapVo> accountCheck(@RequestBody OpenIMAccountCheckDTO accountCheckDTO);
    /*注册用户*/
    @PostMapping(path = "/user/user_register")
    public OpenIMResultVo<String> userRegister(@RequestBody OpenIMRegisterDTO registerDTO);

    /*获取用户TOKEN*/
    @PostMapping(path = "/auth/user_token")
    public OpenIMResultVo<OpenIMTokenVo> userToken(@RequestBody OpenIMTokenDTO tokenDTO);
    /*获取用户TOKEN*/
    @PostMapping(path = "/auth/user_token",headers = "admin=admin")
    public OpenIMResultVo<OpenIMTokenVo> adminToken(@RequestBody OpenIMTokenDTO tokenDTO);

    /*创建群聊*/
    @PostMapping(path = "/group/create_group")
    public OpenIMResultVo<OpenIMGroupInfo> createGroup(@RequestBody OpenIMCreateGroupDTO createGroupDTO);
    /*加入群聊*/
    @PostMapping(path = "/group/join_group")
    public OpenIMResultVo<String> joinGroup(@RequestBody OpenIMJoinGroupDTO joinGroupDTO);

}
